home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 22
/
Cream of the Crop 22.iso
/
utility
/
tsbat50.zip
/
SCANZ.BAT
< prev
next >
Wrap
DOS Batch File
|
1996-04-27
|
6KB
|
198 lines
@echo off
echo.
echo ┌───────────────────────────────────────────────────────────┐
echo │ Scan a zip file for viruses including execompressed files │
echo │ By Prof. Timo Salmi, ts@uwasa.fi, Sat 27-April-1996 │
echo └───────────────────────────────────────────────────────────┘
echo.
rem To reset screen colors. Adjust or omit as appropriate for you.
set color_=
rem If no parameters then give the instructions
if "%1"=="" goto _help
rem First check that the zip file(s) exists
if exist %1 goto _next1
echo File %1 not found
goto _out
rem If you are sure you have this batch configured correctly
rem uncomment the next line
rem goto _next41
:_next1
rem Check that you have the drive r: available (I have r: as ramdisk)
if exist r:\nul goto _next2
echo Working drive R: not found
echo Adjust your configuration, or the %0 batch
goto _out
:_next2
rem Check that the virus programs are available
rem First adjust the paths as befits your own system
if exist d:\virus\mcafee\scan.exe goto _next3
echo File d:\virus\mcafee\scan.exe not found
goto _out
:_next3
if exist d:\virus\f-prot.exe goto _next4
echo File d:\virus\f-fchk.exe not found
goto _out
:_next4
if exist d:\virus\tbav\tbscan.exe goto _next5
echo File d:\virus\tbav\tbscan.exe not found
goto _out
:_next5
if exist d:\virus\im\im.exe goto _next11
echo File d:\virus\im\im.exe not found
goto _out
:_next11
rem Check that pkunzip.exe is available
set found_=
for %%d in (%path%) do if exist %%d\pkunzip.exe set found_=yes
for %%d in (%path%) do if exist %%dpkunzip.exe set found_=yes
if "%found_%"=="yes" goto _next21
echo pkunzip.exe must be at path
goto _out
:_next21
rem Check that all the exeuncompressors are available
if exist c:\box\boxtools\dislite.exe goto _next22
echo File c:\box\boxtools\dislite.exe not found
goto _out
:_next22
if exist c:\box\boxtools\unlzexe.exe goto _next23
echo File c:\box\boxtools\unlzexe.exe not found
goto _out
:_next23
if exist c:\box\boxtools\diet.exe goto _next24
echo File c:\box\boxtools\diet.exe not found
goto _out
:_next24
if exist f:\progs\box\unp.exe goto _next31
echo File f:\progs\box\unp.exe not found
goto _out
:_next31
rem Check that Timo's ask.exe facility is available
set found_=
if exist ask.exe set found_=yes
for %%d in (%path%) do if exist %%d\ask.exe set found_=yes
for %%d in (%path%) do if exist %%dask.exe set found_=yes
if "%found_%"=="yes" goto _next41
echo Timo's ask.exe must be at path or current directory
goto _out
:_next41
rem Make a temporary directory and ensure that it is empty
if not exist r:\tmp$$$\nul mkdir r:\tmp$$$
if exist r:\tmp$$$\*.* echo Deleting all old files from r:\TMP$$$ directory
if exist r:\tmp$$$\*.* del r:\tmp$$$\*.*
rem Unzip all .exe, .com, overlay-files and embedded zips from the zipfile
pkunzip %1 *.exe *.com *.ov* *.zip r:\tmp$$$
if exist r:\tmp$$$\*.zip pkunzip r:\tmp$$$\*.zip *.exe *.com *.ov* r:\tmp$$$
if exist r:\tmp$$$\*.zip del r:\tmp$$$\*.zip
rem Check for nasties with McAfee scan, first pass
echo %color_%
if exist r:\tmp$$$\*.* d:\virus\mcafee\scan r:\tmp$$$\*.* /nomem
rem Check for nasties with tbscan, first pass
:_ask_tb
ask Perform tbscan virus check (y/n)? /d /u
if errorlevel==89 if not errorlevel==90 goto _do_tb
if errorlevel==78 if not errorlevel==79 goto _ask_im
goto _ask_tb
:_do_tb
if exist r:\tmp$$$\*.* d:\virus\tbav\tbscan r:\tmp$$$\*.* nm nb
echo %color_%
rem Check for nasties with Integrity master
:_ask_im
ask Perform Integrity Master virus check (y/n)? /d /u
if errorlevel==89 if not errorlevel==90 goto _do_im
if errorlevel==78 if not errorlevel==79 goto _do_fprot
goto _ask_im
:_do_im
if not exist r:\tmp$$$\*.* goto _do_fprot
d:\virus\im\IM /Pr:\tmp$$$ /VR /NOB /b /RF=nul
IF ERRORLEVEL 64 GOTO VIRUS
IF NOT ERRORLEVEL 24 GOTO DONE
ECHO IM found a possible problem
GOTO DONE
:VIRUS
ECHO IM found signs of a virus
:DONE
rem Check for nasties with f-prot, first pass
:_do_fprot
echo %color_%
if exist r:\tmp$$$\*.* d:\virus\f-prot r:\tmp$$$\*.* /nomem
pause
if exist r:\tmp$$$\*.* d:\virus\f-prot r:\tmp$$$\*.* /nomem /analyse
:_ask_fprot
echo.
ask Next second pass, with expansion, continue (y/n)? /d /u
if errorlevel==89 if not errorlevel==90 goto _expand
if errorlevel==78 if not errorlevel==79 goto _rmdir
goto _ask_fprot
:_expand
rem Expand execompressed files
for %%f in (r:\tmp$$$\*.exe r:\tmp$$$\*.com) do f:\progs\box\unp %%f
pause
rem for %%f in (r:\tmp$$$\*.exe r:\tmp$$$\*.com) do c:\box\boxtools\dislite %%f
rem for %%f in (r:\tmp$$$\*.exe r:\tmp$$$\*.com) do c:\box\boxtools\diet -ra %%f
rem for %%f in (r:\tmp$$$\*.exe) do c:\box\boxtools\unlzexe %%f
rem pause
if exist r:\tmp$$$\*.olz del r:\tmp$$$\*.olz
rem Check for nasties, second pass
if exist r:\tmp$$$\*.* d:\virus\tbav\tbscan r:\tmp$$$\*.* nm nb
pause
if exist r:\tmp$$$\*.* d:\virus\im\IM /Pr:\tmp$$$ /VR /NOB /b /RF=nul
echo %color_%
if exist r:\tmp$$$\*.* d:\virus\f-prot r:\tmp$$$\*.* /nomem
pause
if exist r:\tmp$$$\*.* d:\virus\f-prot r:\tmp$$$\*.* /nomem /analyse
pause
if exist r:\tmp$$$\*.* d:\virus\mcafee\scan r:\tmp$$$\*.* /nomem
goto _rmdir
rem Remove the temporary directory and its files
:_rmdir
if not exist r:\tmp$$$\*.* goto _chdir
echo y | del r:\tmp$$$\*.* > nul
:_chdir
cd r:\
if exist r:\tmp$$$\nul rmdir r:\tmp$$$
goto _out
rem The instructions
:_help
echo Usage: SCANZ [ZipFileName] (Wildcards are allowed)
echo.
echo You will need the following shareware and PD programs to use this batch.
echo They are available from good BBSes or from garbo.uwasa.fi by anonymous ftp.
echo PKUNZIP.EXE from pkz204g.exe
echo SCAN.EXE from scn-22ce.zip
echo F-PROT.EXE and its auxiliary files from fp-222.zip
echo TBSCAN.EXE and its auxiliary files from tbav638.zip
echo IM.EXE and its auxiliary files from i_m261b.zip
echo DISLITE.EXE from dislt115.zip
echo UNLZEXE.EXE from unlzexe7.zip
echo DIET.EXE from diet145f.zip
echo UNP.EXE from unp411.zip
echo ASK.EXE from tsbat48.zip
echo Before using this batch you have to edit all the directory paths of this
echo batch to correspond to your own configuration
echo (or adjust your configuration :-).
echo.
:_out
set found_=
set color_=
if "%pcid_%"=="dell" echo